Add vcsh locate to locate repo holding a file#268
Open
madduck wants to merge 3 commits intoRichiH:mainfrom
Open
Add vcsh locate to locate repo holding a file#268madduck wants to merge 3 commits intoRichiH:mainfrom
vcsh locate to locate repo holding a file#268madduck wants to merge 3 commits intoRichiH:mainfrom
Conversation
This adds the `locate` subcommand, which takes an existing file and returns the repository that's tracking the file. Signed-off-by: martin f. krafft <madduck@madduck.net>
Contributor
Author
|
Looks like the testing framework is broken. |
alerque
reviewed
Mar 29, 2021
alerque
requested changes
Mar 29, 2021
Collaborator
alerque
left a comment
There was a problem hiding this comment.
Besides the other couple comments, I'm wonding if this isn't an inefficient way to get the job done. I know git ls-files supports glob matching. That might be faster that listing everything and grepping. Did you check that?
Lastly does this cover the case of things behind spares checkouts?
alerque
reviewed
Jun 1, 2021
| fatal "'$VCSH_COMMAND_PARAMETER' does not exist" 1 | ||
| fi | ||
| for VCSH_REPO_NAME in $(list); do | ||
| if get_files "$VCSH_COMMAND_PARAMETER" | @GREP@ -q .; then |
Collaborator
There was a problem hiding this comment.
This grep feels very superfluous. Did you look into what the return being given are and if they might suffice for this logic?
alerque
requested changes
Jun 1, 2021
Collaborator
There was a problem hiding this comment.
I resolved the merge conflicts with the default branch, but this still needs some confirmation on a couple points.
- How it handles multiple positives.
- Whether there is a simpler way to code it up, see L538 comment and earlier concern about globbing/iterating everything.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the
locatesubcommand, which takes an existing file andreturns the repository that's tracking the file.
Signed-off-by: martin f. krafft madduck@madduck.net